import service from '@/utils/crmRequest'

export default () => ({
  // 配送商创建
  DISTRIBUTORS_CREATE: (data) => {
    return service({
      url: '/api/distribute/create',
      method: 'post',
      data
    })
  },
  // 配送商列表
  DISTRIBUTORS_LIST: (data) => {
    return service({
      url: '/api/distribute/getList',
      method: 'post',
      data
    })
  },
  // 配送商下拉列表
  DISTRIBUTORS_OPTION_LIST: (params) => {
    return service({
      url: '/api/distribute/getPullList',
      method: 'get',
      params
    })
  },
  // 配送商详情
  DISTRIBUTORS_DETAIL: (params) => {
    return service({
      url: '/api/distribute/getDetail',
      method: 'get',
      params
    })
  },
  // 配送商编辑
  DISTRIBUTORS_EDIT: (data) => {
    return service({
      url: '/api/distribute/edit',
      method: 'put',
      data
    })
  },
  // 配送商信息变更
  DISTRIBUTORS_UPDATE: (data) => {
    return service({
      url: '/api/distribute/update',
      method: 'put',
      data
    })
  },
  // 配送商--完善资质
  DISTRIBUTORS_FILES_UPDATE: (data) => {
    return service({
      url: '/api/distribute/qualification',
      method: 'put',
      data
    })
  },
  // 配送商删除
  DISTRIBUTORS_DELETE: (params) => {
    return service({
      url: '/api/distribute/delete',
      method: 'delete',
      params
    })
  },
  // 终止合作
  DISTRIBUTORS_END: (params) => {
    return service({
      url: '/api/distribute/stopCooperate',
      method: 'get',
      params
    })
  },
  // 注销企业
  DISTRIBUTORS_CANCEL: (params) => {
    return service({
      url: '/api/distribute/cancelAccount',
      method: 'get',
      params
    })
  },
  // 有效配送终端列表--》可模糊搜索
  DISTRIBUTORS_TERMINAL_LIST: (data) => {
    return service({
      url: '/api/dev/list-for-search-terminal',
      method: 'post',
      donNotShowLoading: true,
      data
    })
  },
  // 当前配送商下有效产品列表--》可模糊搜索
  DISTRIBUTORS_PRODUCT_LIST: (params) => {
    return service({
      url: '/api/distributeContractDetail/getProductDistributeList',
      method: 'GET',
      donNotShowLoading: true,
      params
    })
  },
  // 配送终端关系变更，添加终端---列表
  DISTRIBUTORS_RELATION_CHANGE_TERMINAL_LIST: (data) => {
    return service({
      url: '/api/distributeContractDetail/getDistributeTerminals',
      method: 'POST',
      data
    })
  },
  // 配送终端关系变更提交
  DISTRIBUTORS_RELATION_CHANGE_SUBMIT: (data) => {
    return service({
      url: '/api/distributeContractDetail/disTerUpdate',
      method: 'put',
      data
    })
  },
  // 配送终端关系--删除
  DISTRIBUTORS_RELATION_DELETE: (params) => {
    return service({
      url: 'api/distributeContractDetail/deleteDevDis',
      method: 'delete',
      params
    })
  },
  // 根据产品id获取配送商下拉列表
  PRODUCT_FOR_DISTRIBUTORS_LIST: (params) => {
    return service({
      url: '/api/distribute/getPullListByProductId',
      method: 'GET',
      params
    })
  },
  // 配送服务创建
  DISTRIBUTORS_SERVICE_CREATE: (data) => {
    return service({
      url: '/api/distributeContractDetail/create',
      method: 'post',
      data
    })
  },
  // 配送服务详情
  DISTRIBUTORS_SERVICE_DETAIL: (params) => {
    return service({
      url: '/api/distributeContractDetail/getDetail',
      method: 'get',
      params
    })
  },
  // 配送服务编辑
  DISTRIBUTORS_SERVICE_EIDT: (data) => {
    return service({
      url: '/api/distributeContractDetail/edit',
      method: 'put',
      data
    })
  },
  // 配送服务--变更信息
  DISTRIBUTORS_SERVICE_UPDATE: (data) => {
    return service({
      url: '/api/distributeContractDetail/update',
      method: 'put',
      data
    })
  },
  // 配送服务--配送费变更
  DISTRIBUTORS_SERVICE_PRICE_CHANGE: (data) => {
    return service({
      url: '/api/distributeContractDetail/distributePriceUpdate',
      method: 'post',
      data
    })
  },
  // 配送服务--配送费变更,同时要变更的终端列表
  DISTRIBUTORS_SERVICE_PRICE_TERMINAL: (data) => {
    return service({
      url: '/api/distributeContractDetail/getDistributePriceList',
      method: 'post',
      data
    })
  },
  // 配送服务删除
  DISTRIBUTORS_SERVICE_DELETE: (params) => {
    return service({
      url: '/api/distributeContractDetail/delete',
      method: 'delete',
      params
    })
  },
  // 配送服添加终端
  DISTRIBUTORS_SERVICE_ADD_TERMINAL: (data) => {
    return service({
      url: '/api/distributeContractDetail/disTerAssociation',
      method: 'post',
      data
    })
  },
  // 配送服务作废
  DISTRIBUTORS_SERVICE_OBSOLETE: (data) => {
    return service({
      url: '/api/distributeContractDetail/invalidate',
      method: 'post',
      data
    })
  },
  // 配送服务详情
  DISTRIBUTORS_SERVICE_DETAILS: (params) => {
    return service({
      url: '/api/distributeContractDetail/getDetail',
      method: 'get',
      params
    })
  },
  // 配送服务列表
  DISTRIBUTORS_SERVICE_LIST: (data) => {
    return service({
      url: '/api/distributeContractDetail/getList',
      method: 'post',
      data
    })
  },
  // 信用列表
  CREDIT_LIST: (data) => {
    return service({
      url: `/api/distributeContractDetail/getCreditList`,
      method: 'post',
      data
    })
  },
  // 信用列表
  CREDIT_CHANGE: (data) => {
    return service({
      url: `/api/distributeContractDetail/creditUpdate`,
      method: 'post',
      data
    })
  },
  // 配送终端关系列表
  DISTRIBUTORS_TERMINAL_RELATION_LIST: (data) => {
    return service({
      url: `api/distributeContractDetail/getDistributeTerminalList`,
      method: 'post',
      data
    })
  },

  // **************************申请配送商模块********************************
  // 申请配送商--创建
  DISTRIBUTORS_APPLAY_CREATE: (data) => {
    return service({
      url: '/api/distributeApply/create',
      method: 'post',
      data
    })
  },
  // 申请配送商--列表
  DISTRIBUTORS_APPLAY_LIST: (data) => {
    return service({
      url: '/api/distributeApply/list',
      method: 'post',
      data
    })
  },
  // 申请配送商--完成处理
  DISTRIBUTORS_APPLAY_COMPLETE: (data) => {
    return service({
      url: '/api/distributeApply/complete',
      method: 'put',
      data
    })
  },
  // 申请配送商--详情
  DISTRIBUTORS_APPLAY_DETAIL: (params) => {
    return service({
      url: '/api/distributeApply/detail',
      method: 'GET',
      params
    })
  },
})
